package demo1;
abstract class Shape{
    public abstract void drew();
    public int age;
    private String name;

}
class Circle extends Shape{
    public void drew() {
        System.out.print("圆圈 ");
    }
}
class Triangle extends Shape{
    public void drew() {
        System.out.print("三角形 ");
    }
}
class Rectangle extends Shape{
    public void drew() {
        System.out.print("矩形 ");
    }
}


public class test1 {
    public static void drewMap(Shape shape) {
        shape.drew();
    }
    public static void main(String[] args) {
        Shape[] shapes = { new Circle(),new Rectangle(),new Triangle() };
        for(Shape x : shapes) {
            x.drew();
        }
        drewMap(new Triangle());
    }
}
